package exam.xiaozuduikang.exam2019;


class Exam{
    private String student;
    private String courser;
    private int score;
    Exam(String student,String courser,int score){
        this.student=student;
        this.courser=courser;
        this.score=score;
    }


    @Override
    public boolean equals(Object o)
    {
        if(o==null){
            return false;
        }else if(this==o){
            return true;
        }else if(!(o instanceof Exam)){
            return false;
        }
        Exam e=(Exam)o;
        return (e.courser.equals(this.courser))&&(e.student.equals(this.student))&&(e.score==this.score);

    }

    @Override
    public int hashCode() {
        int result=17;
         result=31*result+(student==null? 0:student.hashCode());
         result=31*result+(courser==null? 0:courser.hashCode());
         result=31*result+score;
         return result;
    }
}
